/*
 * Agregar.java
 *
 * Created on 31 de marzo de 2009, 0:21
 */

package finaltsb.GUI;

import java.io.*;
import javax.swing.*;

/**
 *
 * @author  ANA
 */
public class Agregar extends javax.swing.JFrame {
    
    /** Creates new form Agregar */
    public Agregar() {
        initComponents();
        
        this.setDefaultCloseOperation(Principal.DISPOSE_ON_CLOSE);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jpAgregar = new javax.swing.JPanel();
        jlbNuevaPal = new javax.swing.JLabel();
        jlbNuevoSin = new javax.swing.JLabel();
        jbtnNueva = new javax.swing.JButton();
        jbtnCancelar = new javax.swing.JButton();
        jspNuevaPal = new javax.swing.JScrollPane();
        jtaNuevaPal = new javax.swing.JTextArea();
        jspNuevoSin = new javax.swing.JScrollPane();
        jtaNuevoSin = new javax.swing.JTextArea();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(finaltsb.FinalTSBApp.class).getContext().getResourceMap(Agregar.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jpAgregar.setName("jpAgregar"); // NOI18N

        jlbNuevaPal.setText(resourceMap.getString("jlbNuevaPal.text")); // NOI18N
        jlbNuevaPal.setName("jlbNuevaPal"); // NOI18N

        jlbNuevoSin.setText(resourceMap.getString("jlbNuevoSin.text")); // NOI18N
        jlbNuevoSin.setName("jlbNuevoSin"); // NOI18N

        jbtnNueva.setIcon(resourceMap.getIcon("jbtnNueva.icon")); // NOI18N
        jbtnNueva.setText(resourceMap.getString("jbtnNueva.text")); // NOI18N
        jbtnNueva.setName("jbtnNueva"); // NOI18N
        jbtnNueva.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnNuevaActionPerformed(evt);
            }
        });

        jbtnCancelar.setIcon(resourceMap.getIcon("jbtnCancelar.icon")); // NOI18N
        jbtnCancelar.setText(resourceMap.getString("jbtnCancelar.text")); // NOI18N
        jbtnCancelar.setName("jbtnCancelar"); // NOI18N
        jbtnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnCancelarActionPerformed(evt);
            }
        });

        jspNuevaPal.setName("jspNuevaPal"); // NOI18N

        jtaNuevaPal.setColumns(20);
        jtaNuevaPal.setRows(5);
        jtaNuevaPal.setName("jtaNuevaPal"); // NOI18N
        jspNuevaPal.setViewportView(jtaNuevaPal);

        jspNuevoSin.setName("jspNuevoSin"); // NOI18N

        jtaNuevoSin.setColumns(20);
        jtaNuevoSin.setRows(5);
        jtaNuevoSin.setName("jtaNuevoSin"); // NOI18N
        jspNuevoSin.setViewportView(jtaNuevoSin);

        javax.swing.GroupLayout jpAgregarLayout = new javax.swing.GroupLayout(jpAgregar);
        jpAgregar.setLayout(jpAgregarLayout);
        jpAgregarLayout.setHorizontalGroup(
            jpAgregarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpAgregarLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addGroup(jpAgregarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jlbNuevaPal, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jlbNuevoSin))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jpAgregarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jpAgregarLayout.createSequentialGroup()
                        .addComponent(jbtnNueva, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jbtnCancelar))
                    .addComponent(jspNuevoSin)
                    .addComponent(jspNuevaPal, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE))
                .addContainerGap(76, Short.MAX_VALUE))
        );
        jpAgregarLayout.setVerticalGroup(
            jpAgregarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpAgregarLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jlbNuevaPal)
                .addGap(113, 113, 113)
                .addComponent(jlbNuevoSin)
                .addContainerGap(167, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jpAgregarLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jspNuevaPal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(49, 49, 49)
                .addComponent(jspNuevoSin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                .addGroup(jpAgregarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtnNueva, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpAgregar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jpAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtnNuevaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnNuevaActionPerformed
         /** aquí debe llamar al método buscar, para q busque primero si es q 
          * existe esa palabra en el diccionario... de no ser así llama al metodo 
          * agregar. una vez q finaliza ese metodo debe aparecer un pop up con
          * "palabra agregada!! exitosamente!""
         */
        // TODO add your handling code here:
    }//GEN-LAST:event_jbtnNuevaActionPerformed

    private void jbtnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtnCancelarActionPerformed
            this.dispose();        // TODO add your handling code here:
    }//GEN-LAST:event_jbtnCancelarActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Agregar().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbtnCancelar;
    private javax.swing.JButton jbtnNueva;
    private javax.swing.JLabel jlbNuevaPal;
    private javax.swing.JLabel jlbNuevoSin;
    private javax.swing.JPanel jpAgregar;
    private javax.swing.JScrollPane jspNuevaPal;
    private javax.swing.JScrollPane jspNuevoSin;
    private javax.swing.JTextArea jtaNuevaPal;
    private javax.swing.JTextArea jtaNuevoSin;
    // End of variables declaration//GEN-END:variables
    
}
